///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package company.search.ejb;
//
//import entities.Search;
//import facades.CandidateFacade;
//import javax.ejb.Stateless;
//import javax.inject.Inject;
//import sqlgenerators.search.SearchSQLGenerator;
//import sqlgenerators.search.SearchSqlGeneratorInterface;
//
///**
// *
// * @author Alvaro
// */
//@Stateless
//public class NewViewSearchEjb {
//    @Inject
//    private CandidateFacade candidateEJB;
//    private SearchSqlGeneratorInterface sqlGenerator;
//    
//    public NewViewSearchEjb(){
//        sqlGenerator= new SearchSQLGenerator();
//    }
//    
//    public void getPreviewSearchCandidates(Search search){
//        String sql=sqlGenerator.getSqlFromSearch(search);
//        search.setPreviewCandidateList(candidateEJB.getPreviewSearchCandidates(sql, 6, search.getCompany()));
//    }
//    
//    public void getNumberOfValidCandidates(Search search){
//        String sql1=sqlGenerator.getSqlFromSearch(search);
//        search.setValidCandidates(candidateEJB.getNumberOfValidCandidates(sql1, search.getCompany()));
//    }
//    
//    public void getNumberOfValidCandidatesFromLastSearchView(Search search){
//        String sql2=sqlGenerator.getSqlFromSearch(search);
//        search.setCandidatesSinceLastView(candidateEJB.getNumberOfValidCandidatesFromLastSearchView(sql2, search.getCompany(),search));
//    }
//    
//    
//}
